<template>
	<view class="layout">
		<view>
			<button v-if="!isLogin" type="primary" @tap="handleWechatLogin">微信一键登录</button>
		</view>
		<view class="">
			<button type="primary" @tap="totest">测试</button>
			
		</view>
		<tabbar></tabbar>

	</view>
</template>

<script>
	import tabbar from '@/components/custom-tab-bar/custom-tab-bar.vue'
	export default {
		components: {
			tabbar
		},
		data() {
			return {
				showElement: true,
				lastScrollTop: 0,
				threshold: 5 // 向上滑动超过5px就隐藏
			};
		},
		
		onPageScroll(e) {
			console.log('-====',e);
		  },
		computed: {
			isLogin() {
				const flag = this.$store.getters.getIsLogin;
				console.log("登录状态：", flag);
				return flag;
			}		 
		},
		methods: {

			async handleWechatLogin() {
				this.$store.dispatch("login");	
			},
			
			totest() {
				uni.navigateTo({
					url:'/pages/test/test'
				})
			}
		
		}
	}
</script>

<style lang="scss" scoped>
	.layout {
		width: 100%;
		// min-height: 100vh;
		background:
		linear-gradient(to bottom,transparent,#fff 400px),
		radial-gradient(90% 300px at left top,#95EODC，transparent),
		radial-gradient(60% 300px at right top,#D3CBFC，transparent);
	}
	
	
	.hideable-element {
	  background-color: #FF9800;
	  padding: 20rpx;
	  text-align: center;
	  font-size: 30rpx;
	  transition: opacity 0.3s ease;
	}
	.content {
	  padding: 20rpx;
	}
	
</style>
